/**
 * 根据共同的配置修改或者直接自定义个性化的配置
 */

import {
  commonProtoConfig,
  defaultChartOptions,
} from '@/components/common/VisualizationComp/ChartConfig/common'

const {
  titleConfig,
  rightLegendConfig,
  tooltipConfig,
  xAxis,
  yAxis,
  // layoutConfig,
  // scaleConfig,
  themeColorDiscreteConfig,
} = commonProtoConfig

// 散点图回归线特性
const regressionLine = [
  {
    type: 'switch-group',
    label: '散点回归线',
    name: 'regressionLineShow',
    defaultValue: false,
    children: [
      {
        type: 'select',
        label: '回归线类型',
        name: 'regressionLineType',
        defaultValue: 'linear',
        props: {
          options: [
            {
              label: 'exp',
              value: 'exp',
            },
            {
              label: 'linear',
              value: 'linear',
            },
            {
              label: 'loess',
              value: 'loess',
            },
            {
              label: 'log',
              value: 'log',
            },
            {
              label: 'poly',
              value: 'poly',
            },
            {
              label: 'pow',
              value: 'pow',
            },
            {
              label: 'quad',
              value: 'quad',
            },
          ],
        },
      },
    ],
  },
]

//  TBD scatterPlot 数据点point 配置

export const protoConfig = [
  {
    label: '',
    type: 'property',
    children: [
      ...titleConfig,
      ...xAxis,
      ...yAxis,
      ...rightLegendConfig,
      ...tooltipConfig,
      // ...layoutConfig,
      // ...scaleConfig,
      ...regressionLine,
      ...themeColorDiscreteConfig,
    ],
  },
]
/**
 * 图表渲染的默认配置
 */
export const defaultOptions = {
  ...defaultChartOptions,
}
